import React, {
    Component,
} from 'react';
import {
    StyleSheet,
    Dimensions,
    Text,
    View,
    TouchableOpacity,
    ImageBackground,
    Image,
    Platform,
    TextInput
} from 'react-native';

export default class PublishCarArrow extends Component {

    constructor(props) {
        super(props);
        this.state = {

        }
    };

    componentDidMount() {

    }


    render() {
        return (
            <TouchableOpacity
                style={[styles.itemBox, {borderBottomWidth: this.props.hideSepline ? 0:0.3}]}
                activeOpacity={0.8}
                onPress={() => {
                    if (this.props.clickHandle) {
                        this.props.clickHandle()
                    }
                }}
            >
                <View style={styles.itemLeftBox}>
                    <Text style={styles.itemTitleText}>
                        {this.props.name}
                        {
                            this.props.necessary ?
                                <Text style={{ color: '#FB3D3C' }}>*</Text>
                                :
                                null
                        }
                    </Text>
                </View>
                <View style={styles.itemRightBox}>
                    <Text style={this.props.content ? styles.itemDesText2 : styles.itemDesText}>{this.props.content ? this.props.content : (this.props.placeholder ? this.props.placeholder : ('请选择' + this.props.name))}</Text>
                    <Image style={styles.arrowImg} source={require('source/image/comm/icon_tree_arrow.png')} />
                </View>
            </TouchableOpacity>
        )
    }

}

const styles = StyleSheet.create({
    itemBox: {
        width: '100%',
        height: 45,
        borderBottomColor: '#e4e4e4',
        borderBottomWidth: 0.3,
        flexDirection: 'row',
        alignItems: 'center',
        justifyContent: 'space-between'
    },
    itemLeftBox: {
        width: 92,
    },
    itemRightBox: {
        flex: 1,
        marginLeft: 4,
        flexDirection: 'row',
        justifyContent: 'space-between',
        alignItems: 'center'
    },
    itemTitleText: {
        fontSize: 14,
        color: '#222222'
    },
    textInput: {
        color: '#333333',
        fontSize: 14,
        flex: 1,
        height: '100%',
    },
    unitText: {
        fontSize: 14,
        color: '#222',
        marginLeft: 12
    },
    itemDesText: {
        fontSize: 14,
        color: '#999999'
    },
    itemDesText2: {
        fontSize: 14,
        color: '#222'
    },
    arrowImg: {
        width: 15,
        height: 15
    }

})